﻿using SmartRS.com.vn.smartrs.dao;
using SmartRS.com.vn.smartrs.domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SmartRS.com.vn.smartrs.service
{
    public class BillService : BaseService<Bill>
    {
        private static BillService _billService = new BillService();

        private BillService()
        { }

        public static BillService getInstance()
        {
            return _billService;
        }

        public Bill getBillByDeskId(long deskId)
        {
            try
            {
                return BillDao.getInstance().getBillByDeskId(deskId);
            }
            catch(Exception ex)
            {
                throw new Exception("", ex);
            }
        }

        public static IList<Bill> getDataBillBySerialAndDate(string serial, DateTime startDate, DateTime endDate, bool isUseDate)
        {
            try
            {
                return BillDao.getInstance().getListBillBySerialAndDate(serial, startDate, endDate, isUseDate);
            }
            catch(Exception ex)
            {
                throw new Exception("getDataBillBySerialAndDate happened error => " + ex.Message);
            }
        }
    }
}
